<?php header("Access-Control-Allow-Origin:*");

require "vendor/autoload.php";
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();

if (empty($_ENV)) {
    echo "config file does't exist";exit;
}

require 'SzPublish.class.php';
$view = 1;
require 'server.php';

$publisher = SzPublish::get();
$version = $publisher->getAppVersion();
$developer = $publisher->getDeveloper();
unset($publisher);

if (!file_exists("apps/{$developer}/{$version}/www/index.php")) {
    $version = 'latest';
}

error_log('*****************************社团赛结算历史数据开始**************************'."\r\n",3,$_ENV['LOG_ROOT'] . '/UnionDataSettlement-' . date('Y-m-d') . '.log');
require "apps/{$developer}/{$version}/www/dataSettlement.php"; // load the index.php of specified app version
